<?php
require_once('mysql.php');

$todolist_id = $_GET['todolist_id'];
$email = $_GET['email'];

$query_for_user_id = "select id from users where email='$email'";
$result = mysql_query($query_for_user_id) or die(mysql_error().": $query_for_user_id");
$row = mysql_fetch_array($result);
$user_id = $row['id'];
echo $user_id;


$json = array();

$query = "INSERT INTO can_edit(list_id, user_id) values($todolist_id, $user_id)";

$result = mysql_query($query) or die(mysql_error().": $query");

?>
